package com.dlc.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dlc.shop.bean.model.OrderInvoice;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 *
 * @author Citrus
 * @date 2021-08-16 14:22:47
 */
public interface OrderInvoiceMapper extends BaseMapper<OrderInvoice> {
    /**
     * 根据参数查询店铺的订单发票列表
     * @param page
     * @param orderInvoice 参数
     * @return 店铺的订单发票列表
     */
    IPage<OrderInvoice> getShopPage(Page page, @Param("orderInvoice") OrderInvoice orderInvoice);

    /**
     * 获取用户发票列表
     * @param page
     * @param userId 用户id
     * @return 列表
     */
    IPage<OrderInvoice> getUserInvoicePage(Page page,@Param("userId") String userId);

    /**
     * 根据订单发票id获取，app端使用
     *
     * @param orderInvoiceId 订单发票id
     * @return 信息
     */
    OrderInvoice getById(@Param("orderInvoiceId") Long orderInvoiceId);

    /**
     * 该订单是否已经开具发票
     * @param orderNumber
     * @return
     */
    int isUpload(@Param("orderNumber") String orderNumber);

    /**
     * 根据订单id获取发票id
     * @param orderNumber 订单id
     * @return
     */
    Long getByorderNumber(@Param("orderNumber")String orderNumber);

    /**
     * 批量删除
     * @param orderNumbers 被取消的订单id
     */
    void deleteBatch(@Param("orderNumbers")List<String> orderNumbers);
}
